- budget = resource.budgets.find_by(campaign: current_campaign)
- if budget && budget.items.any?
  = infos do
    - balance = budget.revenues_amount.round(budget.currency_precision) - budget.expenses_amount.round(budget.currency_precision)
    = link_to(controller: :activity_budgets, action: :edit, id: budget.id, redirect: request.fullpath) do
      = info ActivityBudget.human_attribute_name(:revenues_amount), budget.revenues_amount.round(budget.currency_precision).l(currency: budget.currency)
    = link_to(controller: :activity_budgets, action: :edit, id: budget.id, redirect: request.fullpath) do
      = info ActivityBudget.human_attribute_name(:expenses_amount), budget.expenses_amount.round(budget.currency_precision).l(currency: budget.currency)
    .big-info{class: (balance > 0 ? :positive : balance <= 0 ? :negative : :caution)}
      %span.title= :balance.tl
      %span.value= balance.round(budget.currency_precision).l(currency: budget.currency)
- else
  .help-panel
    %p.help-message= :no_budget_defined_for_current_campaign.tn
    - if current_campaign.preceding && resource.budgets.find_by(campaign: current_campaign.preceding)
      - source = resource.budgets.find_by(campaign: current_campaign.preceding)
      = link_to(:copy_previous_budget.tl, { controller: :activity_budgets, action: :duplicate, activity_id: resource.id, campaign_id: current_campaign.id, id: source.id, edit: true, redirect: request.fullpath }, method: :post, class: 'btn btn-default')
    - other_budgets = current_campaign.activity_budgets.where.not(activity_id: resource.id)
    - if other_budgets.any?
      = dropdown_menu_button(:copy_from_another_activity.tl) do |menu|
        - other_budgets.includes(:activity).order('activities.name').each do |budget|
          - menu.item budget.activity_name, { controller: :activity_budgets, action: :duplicate, id: budget.id, activity_id: resource.id, campaign_id: current_campaign.id, edit: true, redirect: request.fullpath }, method: :post
    - url_options = budget ? { action: :edit, id: budget.id } : {action: :new, activity_id: resource.id, campaign_id: current_campaign.id}
    = link_to(:new_budget.tl, url_options.merge(controller: :activity_budgets, redirect: request.fullpath), class: 'btn btn-default')
